	PROGRAM ADD
	INTEGER OBS,BSO,VAR,YEAR
	DIMENSION DAT(50,5)
	CHARACTER*114 A,B,C,D
	CHARACTER*23 TIT(50)
	OPEN(UNIT=3,CARRIAGECONTROL='LIST',STATUS='UNKNOWN')
C
	J=1
501	READ(2,11,END=500)YEAR,TIT(J),(DAT(J,K),K=1,5)
	J=J+1
	GO TO 501
500	J=J-1	
C
40	READ(1,10,END=200)A
10	FORMAT(A)
	WRITE(3,10)A
	READ(1,10)B
        DECODE(1,22,B(3:3))VAR
22   	FORMAT(I1)
        DECODE(2,20,B(8:9))OBS
	BSO=OBS+1
20	FORMAT(I2)
   	ENCODE(2,21,B(8:9))BSO
21 	FORMAT(I2)
	WRITE(3,10)B
	READ(1,10)C
	WRITE(3,10)C
C
	DO 30 I=1,OBS
	READ(1,10)D
	WRITE(3,10)D
30	CONTINUE
11	FORMAT(1X,I4,3X,A,5F11.0)
	NSKIP=110-VAR*9
	DO 31 M=1,J
	IF(C(1:20).EQ.TIT(M)(1:20))THEN
		WRITE(3,12)(DAT(M,I),I=1,VAR),YEAR
		WRITE(6,13)TIT(M),(DAT(M,I),I=1,VAR),YEAR
13	FORMAT(1X,A,1X,<VAR>F9.2,2X,I4)
		END IF
31	CONTINUE
12 	FORMAT(<VAR>F9.2,<NSKIP>X,I4)
	GO TO 40
200	STOP
	END
